<template>
    <div class="custom-input">
        <span class="label">{{config.fieldName}}</span>
        <el-date-picker
            class="filter-item"
            v-model="cvalue"
            format="yyyy-MM-dd"
            value-format="yyyy-MM-dd"
            range-separator="至"
            type="date"
            start-placeholder="开始时间"
            end-placeholder="结束时间"
            :picker-options="config.pickerOptions"
        ></el-date-picker>
    </div>
</template>

<script>
    export default {
        name: "customDate",
        data() {
            return {
                cvalue:''
            }
        },
        props:{
            value:{
                type:[String,Number],
                default:'',
            },
            config:{
                type:[Object],
                default:{},
            }
        },
        watch:{
            value(val){
                this.cvalue=val;
            },
            cvalue(val){
                this.$emit('input',val);
                this.$emit('change',val)
            }
        }
    }
</script>

<style scoped lang="stylus">
    @import "comp.styl"
</style>
